]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: initialize the agent asynchronously
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 11 Jan 2018 09:50:45 +0000 (10:50 +0100)
committerLubomir Rintel <lkundrak@v3.sk>
Mon, 23 Apr 2018 08:45:20 +0000 (10:45 +0200)
This also bumps the NM requirement. We actually already use API from
1.0, but regularly hit various NetworkManager bugs with versions prior
to 1.10.2. 1.10.4 fixes the asynchronous agent initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=789811
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/63

js/ui/components/networkAgent.js
meson.build

index 75f42037308ae477618b33e4f3491569f56ec8b4..9050b8a508966c26415cb3ccddd1e85d0a40ce8d 100644 (file)
@@ -604,12 +604,17 @@ var NetworkAgent = new Lang.Class({
 
         this._native.connect('new-request', this._newRequest.bind(this));
         this._native.connect('cancel-request', this._cancelRequest.bind(this));
-        try {
-            this._native.init(null);
-        } catch(e) {
-            this._native = null;
-            logError(e, 'error initializing the NetworkManager Agent');
-        }
+
+        this._initialized = false;
+        this._native.init_async(GLib.PRIORITY_DEFAULT, null, (o, res) => {
+            try {
+                this._native.init_finish(res);
+                this._initialized = true;
+            } catch(e) {
+                this._native = null;
+                logError(e, 'error initializing the NetworkManager Agent');
+            }
+        });
     },
 
     enable() {
@@ -617,7 +622,7 @@ var NetworkAgent = new Lang.Class({
             return;
 
         this._native.auto_register = true;
-        if (!this._native.registered)
+        if (this._initialized && !this._native.registered)
             this._native.register_async(null, null);
     },
 
@@ -640,7 +645,7 @@ var NetworkAgent = new Lang.Class({
             return;
 
         this._native.auto_register = false;
-        if (this._native.registered)
+        if (this._initialized && this._native.registered)
             this._native.unregister_async(null, null);
     },
 
index bfc2ff76cf16c3b853766bff3175cac0635ff5ad..1c0b68c7184fbd16bc23bcbaa51c8b5d07e5079e 100644 (file)
@@ -31,7 +31,7 @@ ibus_req = '>= 1.5.2'
 
 bt_req = '>= 3.9.0'
 gst_req = '>= 0.11.92'
-nm_req = '>= 0.9.8'
+nm_req = '>= 1.10.4'
 secret_req = '>= 0.18'
 
 gnome = import('gnome')